using System.Collections.Generic;
using UnityEngine;

[ExecuteInEditMode]
public class EditAllLevel : MonoBehaviour
{
	public bool isrunflag;

	public List<editlevel> alllevel;

	private editlevel templevel;

	private void Update()
	{
		if (isrunflag)
		{
			isrunflag = false;
			foreach (Transform item in base.transform)
			{
				templevel = null;
				templevel = item.gameObject.GetComponent<editlevel>();
				if (templevel != null && alllevel.IndexOf(templevel) == -1)
				{
					alllevel.Add(templevel);
				}
				UnityVersionUtil.SetActiveRecursive(item.transform.gameObject, state: true);
			}
			for (int i = 0; i < alllevel.Count; i++)
			{
				alllevel[i].isrunflag = true;
			}
		}
	}
}
